_require local "../../../../basis.smi"
_require local "../../../../smlformat-lib.smi"
(* _require local "../../../extensions/usererror/main/UserError.ppg.smi" *)

_require "../../../data/symbols/main/RecordLabel.smi"
_require "../../../data/symbols/main/Symbol.smi"
_require "../../../compilerIRs/absyn/main/Absyn.smi"
_require local "../../../compilerIRs/absyn/main/AbsynFormatter.smi"
_require "../../../compilerIRs/patterncalc/main/PatternCalc.ppg.smi"
_require "../../../compilerIRs/idcalc/main/IDCalc.ppg.smi"

structure NameEvalError =
  struct    
    type code = string
    exception CyclicKind of (code * {tvarList: IDCalc.tvar list})
    exception IllegalBuiltinTy of code * {symbol: Symbol.longsymbol}
    exception InvalidOverloadInst of code * {longsymbol: Symbol.longsymbol}
    exception FFIFunTyIsNotAllowedHere of code * PatternCalc.ffiTy
    exception ProvideFunctorMismatch of code * {longsymbol: Symbol.longsymbol}
    exception ProvideFunparamMismatch of code * 
                                         {longsymbol: Symbol.longsymbol}
    exception ProvideRedundantCon of code * {longsymbol: Symbol.longsymbol}
    exception ProvideUndefinedStr of code * {longsymbol: Symbol.longsymbol}
    exception ProvideStrRep of code * {longsymbol: Symbol.longsymbol}
    exception ProvideUndefinedFunctorName of code * {longsymbol: Symbol.longsymbol}
    exception ProvideUndefinedCon of code * {longsymbol: Symbol.longsymbol}
    exception ProvideConType of code * {longsymbol: Symbol.longsymbol}
    exception ProvideRuntimeType of code * {longsymbol: Symbol.longsymbol}
    exception ProvideEquality of code * {longsymbol: Symbol.longsymbol}
    exception ProvideArity of code * {longsymbol: Symbol.longsymbol}
    exception ProvideExceptionRepID of code * {longsymbol: Symbol.longsymbol}
    exception ProvideExceptionRep of code * {longsymbol: Symbol.longsymbol}
    exception ProvideExceptionDef of code * {longsymbol: Symbol.longsymbol}
    exception ProvideExceptionType of code * {longsymbol: Symbol.longsymbol}
    exception ProvideOpaqueExpected of code * {longsymbol: Symbol.longsymbol}
    exception ProvideDtyExpected of code * {longsymbol: Symbol.longsymbol}
    exception ProvideInequalTfun of code * {longsymbol: Symbol.longsymbol}
    exception ProvideUndefinedException of code * 
                                           {longsymbol: Symbol.longsymbol}
    exception ProvideUndefinedTypeName of code * 
                                          {longsymbol: Symbol.longsymbol}
    exception ProvideVariableAlias of code * {longsymbol: Symbol.longsymbol}
    exception ProvideVarIDExpected of code * {longsymbol: Symbol.longsymbol}
    exception ProvideUndefinedID of code * {longsymbol: Symbol.longsymbol}
    exception ProvideUndefinedFunctor of (code * {symbol: Symbol.symbol})
    exception ProvideIDType of code * {longsymbol: Symbol.longsymbol}
    exception ProvideOverload of code * {longsymbol: Symbol.longsymbol}
    exception ProvideBuiltIn of code * {longsymbol: Symbol.longsymbol}
    exception InterfaceMisMatchNotFoundFunctor of code * {symbol: Symbol.symbol}
    exception SigMisMatchNotFoundStr of code * {symbol: Symbol.symbol}
    exception SigMisMatchNotFoundVar of code * {symbol: Symbol.symbol}
    exception SigMisMatchNotFoundExn of code * {symbol: Symbol.symbol}
    exception SigMisMatchNotFoundCon of code * {symbol: Symbol.symbol}
    exception SigMisMatchNotFoundDataTy of code * {symbol: Symbol.symbol}
    exception FunctorNotFound of code * {symbol: Symbol.symbol}
    exception SignatureNotFound of code * {symbol: Symbol.symbol}
    exception ExnNotFound of code * {symbol: Symbol.symbol}
    exception DtyUndefinedInSpec of code * {longsymbol: Symbol.longsymbol}
    exception StrUndefinedInSpec of code * {longsymbol: Symbol.longsymbol}
    exception TypUndefinedInSpec of code * {longsymbol: Symbol.longsymbol}
    exception ExceptionNameUndefined of code * {longsymbol: Symbol.longsymbol}
    exception ExceptionExpected of code * {longsymbol: Symbol.longsymbol}
    exception SpecTyExpected of code * {longsymbol: Symbol.longsymbol}
    exception FunIdUndefined of code * {symbol: Symbol.symbol}
    exception SigIdUndefined of code * {symbol: Symbol.symbol}
    exception SIGStrUndefined of code * {longsymbol: Symbol.longsymbol}
    exception SIGShare of code * {longsymbolList: Symbol.longsymbol list}
    exception SIGVarUndefined of code * {longsymbol: Symbol.longsymbol}
    exception SIGExnType of code * {longsymbol: Symbol.longsymbol}
    exception SIGExnExpected of code * {longsymbol: Symbol.longsymbol}
    exception SIGConExpected of code * {longsymbol: Symbol.longsymbol}
    exception SIGConType of code * {longsymbol: Symbol.longsymbol}
    exception SIGEqtype of code * {longsymbol: Symbol.longsymbol}
    exception SIGConUndefined of code * {longsymbol: Symbol.longsymbol}
    exception SIGConNotExported of code * 
                                   {conSymbol: Symbol.symbol,
                                    typSymbol: Symbol.longsymbol}
    exception SIGConNotFound of code * {longsymbol: Symbol.longsymbol}
    exception SIGConNotFoundInDty of code * {longsymbol: Symbol.longsymbol}
    exception SIGDtyrepUndefined of code * {longsymbol: Symbol.longsymbol}
    exception SIGDtyUndefined of code * {longsymbol: Symbol.longsymbol}
    exception SigErrorInSigShare of code * 
                                    {longsymbolList: Symbol.longsymbol list}
    exception EqtypeInSigwhere of code * {longsymbol: Symbol.longsymbol}
    exception EqtypeInSigShare of code * 
                                  {longsymbolList: Symbol.longsymbol list}
    exception ArityErrorInSigShare of code * 
                                      {longsymbolList: Symbol.longsymbol list}
    exception ArityErrorInSigwhere of code * 
                                      {longsymbolList: Symbol.longsymbol list}
    exception TypeErrorInSigwhere of code * {longsymbol: Symbol.longsymbol}
    exception TypUndefinedInSigshare of code * {longsymbol: Symbol.longsymbol}
    exception TypUndefinedInSigwhere of code * {longsymbol: Symbol.longsymbol}
    exception SIGTypUndefined of code * {longsymbol: Symbol.longsymbol}
    exception SIGDtyrepType of code * {longsymbol: Symbol.longsymbol}
    exception SIGDtyrepId of code * {longsymbol: Symbol.longsymbol}
    exception SIGDtyrepRequired of code * {longsymbol: Symbol.longsymbol}
    exception SIGDtyMismatch of code * {longsymbol: Symbol.longsymbol}
    exception SIGDtyRequired of code * {longsymbol: Symbol.longsymbol}
    exception SIGTyconArity of code * {longsymbol: Symbol.longsymbol}
    exception SIGDtyArity of code * {longsymbol: Symbol.longsymbol}
    exception SIGTypconMismatch of code * {longsymbol: Symbol.longsymbol}
    exception SIGTypDefExpected of code * {longsymbol: Symbol.longsymbol}
    exception SIGIlleagalShare of code * {longsymbol: Symbol.longsymbol}
    exception SIGIlleagalRealizer of code * {longsymbol: Symbol.longsymbol}
    exception SIGArity of code * {longsymbol: Symbol.longsymbol}
    exception SIGConNotInSig of code * {longsymbol: Symbol.longsymbol}
    exception TypArity of code * {longsymbol: Symbol.longsymbol}
    exception VarPatExpected of code * {longsymbol: Symbol.longsymbol}
    exception DataTypeNameExpected of code * {longsymbol: Symbol.longsymbol}
    exception ExnExpected of code * {longsymbol: Symbol.longsymbol}
    exception ExnUndefined of code * {longsymbol: Symbol.longsymbol}
    exception DataTypeNameUndefined of code * {longsymbol: Symbol.longsymbol}
    exception StructureNameUndefined of code * {longsymbol : Symbol.longsymbol}
    exception StructureRepOfFuncrorArgInInterface of code * {longsymbol : Symbol.longsymbol}
    exception FunctorNameUndefined of code * {symbol : Symbol.symbol}
    exception DuplicateDtyInSpec of code * Symbol.symbol
    exception DuplicateConInSpec of code * Symbol.symbol
    exception DuplicateVarInSpec of code * Symbol.symbol
    exception DuplicateStrInStrbind of code * Symbol.symbol
    exception DuplicateConNameInDty of code * Symbol.symbol
    exception DuplicateVar of code * Symbol.symbol
    exception DuplicateConName of code * Symbol.symbol
    exception DuplicateStrInSpec of code * Symbol.symbol
    exception DuplicateIdInSpec of code * Symbol.symbol
    exception DuplicateExnName of code * Symbol.symbol
    exception DuplicateTypInSpec of code * Symbol.symbol
    exception DuplicateTypInDty of code * Symbol.symbol
    exception DuplicateTypInTypeDecl of code * Symbol.symbol
    exception DuplicateVarInRecDecl of code * Symbol.symbol
    exception DuplicateFunVarInFunDecl of code * Symbol.symbol
    exception DuplicateTypParms of code * Symbol.symbol
    exception DuplicateVarInPattern of code * Symbol.symbol
    exception DuplicateTypName of code * Symbol.symbol
    exception DuplicateFunctor of code * Symbol.symbol
    exception DuplicateStrName of code * Symbol.symbol
    exception DuplicateRecordLabelInKind of code * RecordLabel.label
    exception DuplicateRecordLabelInRawType of code * RecordLabel.label
    exception DuplicateRecordLabelInExp of code * RecordLabel.label
    exception DuplicateRecordLabelInPat of code * RecordLabel.label
    exception DuplicateRecordLabelInUpdate of code * RecordLabel.label
    exception DuplicateSigname of code * Symbol.symbol
    exception ImproperSigshare of code * {longsymbol: Symbol.longsymbol}
    exception ImproperSigwhere of code * {longsymbol: Symbol.longsymbol}
    exception NonConstructor of code * {pat:PatternCalc.plpat}
    exception IlleagalFunID of code * {pat:PatternCalc.plpat}
    exception TvarNotFound of code * {symbol: Symbol.symbol}
    exception TypNotFound of code * {longsymbol: Symbol.longsymbol}
    exception VarNotFound of code * {longsymbol: Symbol.longsymbol}
    exception ConNotFound of code * {longsymbol: Symbol.longsymbol}
    exception VarOrConNotFound of code * {longsymbol: Symbol.longsymbol}
    exception BuiltinTyNotFound of code * {symbol: Symbol.symbol}
    exception RuntimeTyNotFound of code * {symbol: Symbol.symbol}
    exception PrimitiveNotFound of code * {symbol: Symbol.symbol}
    exception FunctorParamRestriction of code * 
                                         {longsymbol: Symbol.longsymbol}
    exception StrNotFound of code * {longsymbol: Symbol.longsymbol}
    exception ProvideFunctorIdMismatchInFunapp of (code * {longsymbol: Symbol.longsymbol})
    exception ProvideParamIdMismatchInFunapp of (code * {longsymbol: Symbol.longsymbol})
    exception InvalidKind of code * Absyn.tvarKind
    exception InvalidKindName of code * string
    exception FlexRecordNotAllowed of code * Absyn.ty
    exception LIFTEDPropNotAllowedInOpaqueInterface of code * {symbol:Symbol.symbol}
  end
